package com.gmail.avenderov.list;

/**
 * Default implementation of {@link Node} interface.
 */
class NodeImpl<T> implements Node<T> {
    private T value;
    private Node<T> next;

    public NodeImpl(T value) {
        this(value, null);
    }
    
    public NodeImpl(T value, Node<T> next) {
        this.value = value;
        this.next = next;
    }
    
    
    @Override
    public void setNext(Node<T> next) {
        this.next = next;
    }

    @Override
    public void setValue(T value) {
        this.value = value;
    }

    @Override
    public Node<T> getNext() {
        return next;
    }

    @Override
    public T getValue() {
        return value;
    }
    
}
